<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}

			#myCan {
				background-color: skyblue;
			}
		</style>
	</head>
	<body>
		<canvas id="myCan" width="1000px" height="800px"></canvas>
		<script type="text/javascript">
			var oC = document.getElementById('myCan');
			var ctx = oC.getContext('2d');
			// 将坐标原点平移到画布中心
			ctx.translate(500, 400);
			// ctx.arc(0,0,300,0,2*Math.PI);
			for (var i = 400; i >= 0; i -= 10) {
				ctx.beginPath();
				ctx.fillStyle = rgbColor();
				ctx.arc(0, 0, i, 0, 2 * Math.PI);
				ctx.fill();
				ctx.stroke();
			}
			// ctx.stroke();
console.log(rgbColor());
			function rgbColor() {
				let r = Math.floor(Math.random() * 256);
				let g = Math.floor(Math.random() * 256);
				let b = Math.floor(Math.random() * 256);
				let rgb = `rgb(${r},${g},${b})`;
				return rgb;
			}
		</script>
	</body>
</html>
